]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionDownloader: Use common message dialog layout
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 26 Jun 2019 17:51:18 +0000 (19:51 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 26 Jun 2019 18:49:46 +0000 (20:49 +0200)
While the confirmation dialog for extension installation is simpler
than - say - authentication dialogs, it still makes sense to re-use
the common content layout instead of duplicating it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/600

js/ui/extensionDownloader.js

index fdef0b9d20cfd14375fdd113a1b55dcab4ead057..184db2464de77d6916f1873214034cdb9741233f 100644 (file)
@@ -3,6 +3,7 @@
 const { Clutter, Gio, GLib, GObject, Soup, St } = imports.gi;
 
 const Config = imports.misc.config;
+const Dialog = imports.ui.dialog;
 const ExtensionUtils = imports.misc.extensionUtils;
 const ExtensionSystem = imports.ui.extensionSystem;
 const FileUtils = imports.misc.fileUtils;
@@ -194,19 +195,14 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
                            default: true
                          }]);
 
-        let message = _("Download and install “%s” from extensions.gnome.org?").format(info.name);
-
-        let box = new St.BoxLayout({ style_class: 'message-dialog-main-layout',
-                                     vertical: false });
-        this.contentLayout.add(box);
-
-        let gicon = new Gio.FileIcon({ file: Gio.File.new_for_uri(REPOSITORY_URL_BASE + info.icon) })
-        let icon = new St.Icon({ gicon: gicon });
-        box.add(icon);
+        let content = new Dialog.MessageDialogContent({
+            title: _("Download and install “%s” from extensions.gnome.org?").format(info.name),
+            icon: new Gio.FileIcon({
+                file: Gio.File.new_for_uri(`${REPOSITORY_URL_BASE}${info.icon}`)
+            })
+        });
 
-        let label = new St.Label({ style_class: 'message-dialog-title headline',
-                                   text: message });
-        box.add(label);
+        this.contentLayout.add(content);
     }
 
     _onCancelButtonPressed(button, event) {